<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <ul>
        <li>111</li>
        <li>222</li>
        <li>333</li>
        <li>444</li>
    </ul>
</body>
    <script>
        var getli = document.querySelectorAll("li")
        getli.forEach(function(item,key){
        item.onclick = function(){
            var that = this
            setTimeout(function(){
                that.style.color = "red"
            }, 500);
        }
        })
    </script>
</html>